﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
  <joined-subclass name="EnetaMvc.Core.Domain.Events.Event,EnetaMvc.Core" extends="EnetaMvc.Core.Domain.Content.ContentItem,EnetaMvc.Core" table="event">

    <key column="content_item_id" />

    <property name="VenueName" column="venue_name" type="string" />
    <property name="VenueMapUrl" column="venue_map_url" type="string" />
    <property name="Seats" column="seats" type="int" />
    <property name="HasRealEvent" column="has_real_event" type="bool" />
    <property name="HasVirtualEvent" column="has_virtual_event" type="bool" />
    <property name="PercentOfSlides" column="percent_of_slides" type="int" />
    <property name="PercentOfDemos" column="percent_of_demos" type="int" />
    <property name="RegistrationEndDate" column="registration_ends" type="DateTime" />
    <property name="BannerImageUrl" column="banner_image_url" type="string" />
    <property name="BannerTargetUrl" column="banner_target_url" type="string" />
    <property name="StartDate" column="start_date" type="DateTime" />
    <property name="EndDate" column="end_date" type="DateTime" />
    <property name="TechnicalLevel" column="technical_level" type="int" not-null="false" />

    <bag name="Attendees" table="event_attendee">
      <key column="event_id" />
      <one-to-many class="EnetaMvc.Core.Domain.Events.EventAttendee,EnetaMvc.Core" />
    </bag>

    <bag name="MyRoles" table="event_target_audience">
      <key column="event_id" />
      <many-to-many class="EnetaMvc.Core.Domain.Common.MyRole,EnetaMvc.Core" column="my_role_id" />
    </bag>
  </joined-subclass>
</hibernate-mapping>